﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestLink2Net.Entities;
using TestLink2Net.Bal.Interfaces;

namespace TestLink2Net.Bal
{
    public class RightMaster:IRightMaster
    {
        private RightMaster()
        {
        }

        public static RightMaster Instance
        {
            get
            {
                return new RightMaster();
            }
        }

        public RightList GetRightsByUserName(string userName)
        {
            RightList result = new RightList();
            Right someRight = new Right();
            someRight.Id = new Guid();
            someRight.RightName = "SVN Access";

            if (userName.ToLower().StartsWith("j"))
                result.Add(someRight);
            return result;
        }

        public RightList GetRightsByRoleName(string roleName)
        {
            RightList result = new RightList();
            Right someRight = new Right();
            someRight.Id = new Guid();
            someRight.RightName = "SVN Access";

            if (roleName.ToLower() == "developer")
                result.Add(someRight);
            return result;
        }

    }
}
